import easygui as ll
import sys
while 1 :
     ll.msgbox("hi,everyone")
     msg = "hello"
     title = "come"
     choices = ["love","learn","play"]
     choice = ll.choicebox(msg,title,choices)
     ll.msgbox("your choice is:" + str(choice) ,"go to next choices",image= "picture1.gif")
     if str(choice) == "learn" :
          ll.msgbox("you choose right way,continue")
          choice_1 = ["python","java","c++","php",]
          ll.choicebox(msg="come to choose",title= "really study" ,choices = choice_1,)
     else :
           ll.msgbox("wrong answer bye bye")
           break

     msg = "try again ?"
     title = "come"
     if ll.ccbox(msg,title) :
        pass
     else :
        ll.enterbox(msg="say something about this")
        msg_1 = "请填写以下联系方式"
        title_1 = "账号管理"
        fieldnames = ["*username","*name","*password","telephone","*mobile phone","E-mail"]
        fieldvalues = []
        fieldvalues = ll.multenterbox(msg_1,title_1, fieldnames)
        while 1 :
            if fieldvalues == None :
                break
            errmsg = ""
            for i in range(len(fieldnames)) :
                option = fieldnames[i].strip()
                if fieldvalues[i].strip() == "" and option[0] == "*" :
                    errmsg += ("[%s]为必填。 \n\n " % fieldnames[i] )
            if errmsg == "" :
                break
            fieldvalues = ll.multenterbox(errmsg,title_1,fieldnames,fieldvalues)
        ll.msgbox("用户资料如下: %s" % str(fieldvalues))
        #check_1 = ll.multpasswordbox(msg="please input username and password",title="log in",fields = ("username: ","password:"))
        i=1
        while i :
            check_1 = ll.multpasswordbox(msg="please input username and password", title="log in",fields=("username: ", "password:"))
            if check_1[0] == fieldvalues[0] :
                 if check_1[1] == fieldvalues[2] :
                    ll.msgbox("you have already logged")
                    i=0

            else :
                ll.msgbox("wrong,please check out")
         #去查查 multpasswordbox
        sys.exit(0)
